 package org.mics.mq.rocketmq.aliyun.config;

import java.util.Properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

import com.aliyun.openservices.ons.api.PropertyKeyConst;

import lombok.Data;

/**
 * rocketmq阿里云配置类
 * @author mics
 * @date 2022-1-26
 * @version  1.0
 */
@Data
@ConfigurationProperties(prefix = "rocketmq")
public class RocketMqConfig {
	private String accessKey;
	private String secretKey;
	private String nameSrvAddr;
	
	private String groupId;
	private String topic;
	private String tag;
	
	public Properties getMqPropertie() {
        Properties properties = new Properties();
        properties.setProperty(PropertyKeyConst.AccessKey, this.accessKey);
        properties.setProperty(PropertyKeyConst.SecretKey, this.secretKey);
        properties.setProperty(PropertyKeyConst.NAMESRV_ADDR, this.nameSrvAddr);
        properties.setProperty(PropertyKeyConst.GROUP_ID, this.groupId);
        return properties;
    }
}
